package com.dean.service;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName DeanLogThreadService
 * @Description dean日志线程池
 * @Author dean
 * @Date 2021/10/4 10:12
 */
public class DeanLogThreadService {
    private static ThreadPoolExecutor executorService =
            new ThreadPoolExecutor(1,1,30, TimeUnit.SECONDS,
                    new LinkedBlockingDeque<>(1),
                    Executors.defaultThreadFactory(),
                    new ThreadPoolExecutor.AbortPolicy());
    private DeanLogThreadService() {}

    public static ThreadPoolExecutor getInstance() {
        return executorService;
    }
}
